import {get,post,put,delete} from '@/utils/request'

export function login(data) {
    return post('/user/login', data)
}

export function getUserInfo(id) {
    return get(`/user/${id}`)
}

export function updateUser(id, data) {
    return put(`/user/${id}`, data)
}

export function deleteUser(id) {
    return delete(`/user/${id}`)
}

// 如果需要自定义配置
export function customRequest() {
    return request.request({
        url: '/custom',
        method: 'post',
        data: { foo: 'bar' },
        headers: { 'Content-Type': 'application/json' }
    })
}
